﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Web;

namespace Chbl.Models
{
    public class Gallery
    {
        private bool _requestIsAuthenticated;
        private string _userName;
        private const int PhotoAlbumId = 1;
        private const int FileAlbumId = 6;

        public Gallery(IIdentity identity)
        {
            _requestIsAuthenticated = identity.IsAuthenticated;
            _userName = identity.Name;
        }
        public string GetUrl(int galleryAlbumId)
        {
            if (_requestIsAuthenticated)
            {
                return string.Format("http://gallery.chbl.org/AutoLogin.aspx?u={0}&aid={1}", _userName, galleryAlbumId);
            }
            return string.Format("http://gallery.chbl.org?aid={0}", galleryAlbumId);
        }

        public string PhotoGalleryUrl
        {
            get { return GetUrl(PhotoAlbumId); }
        }
        
        public string FilesGalleryUrl
        {
            get { return GetUrl(FileAlbumId); }
        }
    }
}